//
//  LMJMenuCellCell.m
//  ShowYork
//
//  Created by hxh on 2021/3/26.
//  Copyright © 2021 hxh. All rights reserved.
//

#import "LMJDropDownMenuCell.h"

@interface LMJDropDownMenuCell ()
@property (nonatomic,strong)UILabel *title;
@end

@implementation LMJDropDownMenuCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setUI];
    }
    return self;
}

- (void)setUI{
    self.title = [[UILabel alloc]init];
    self.title.textColor = C51;
    self.title.font = font(14);
    [self.contentView addSubview:self.title];
    [self.title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).offset(32);
        make.bottom.equalTo(self.contentView);
    }];
}

+(instancetype)cellWithTableView:(UITableView *)tableView{
    NSString *ID = @"LMJDropDownMenuCell";
    LMJDropDownMenuCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell) {
        cell = [[LMJDropDownMenuCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return cell;
}
- (void)setModel:(CampusParamItemModel *)model{
    _model = model;
    self.title.text = model.value;
    self.title.textColor = model.isSelected?RGBA(86, 128, 250, 1):C51;
}
@end
